public class HuffmanNode<T> {
    private T data;     //数据元素
    public double weight;   //权重
    public int parent;
    public int lchild;
    public int rchild;
    //创建不带数据值的离散结点，即叶子结点，无左右孩子并标记为-1
    public HuffmanNode()
    {
        data = null;
        weight = 0;
        parent = 0;
        lchild = -1;
        rchild = -1;
    }
    //创建带数据值得离散结点，即叶子结点，五左右孩子并标记为-1
    public HuffmanNode(T x,double w)
    {
        data = x;
        weight = w;
        parent = 0;
        lchild = -1;
        rchild = -1;
    }
    public T getData()
    {
        return data;
    }
}
